﻿Public Class movCaballo
    'la aplicacion de operadores es en sentido horario
    Public Shared Function operador1(ByVal pos As Integer) As Integer 'dos izquierda uno arriba
        Dim i, j As Integer
        i = pos \ 10 - 1
        j = pos Mod 10 - 2
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function
    Public Shared Function operador2(ByVal pos As Integer) As Integer 'uno izquierda dos arriba
        Dim i, j As Integer
        i = pos \ 10 - 2
        j = pos Mod 10 - 1
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function
    Public Shared Function operador3(ByVal pos As Integer) As Integer 'uno derecha dos arriba
        Dim i, j As Integer
        i = pos \ 10 - 2
        j = pos Mod 10 + 1
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function
    Public Shared Function operador4(ByVal pos As Integer) As Integer 'dos derecha uno arriba
        Dim i, j As Integer
        i = pos \ 10 - 1
        j = pos Mod 10 + 2
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function
    Public Shared Function operador5(ByVal pos As Integer) As Integer 'dos derecha uno abajo
        Dim i, j As Integer
        i = pos \ 10 + 1
        j = pos Mod 10 + 2
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function
    Public Shared Function operador6(ByVal pos As Integer) As Integer 'uno derecha dos abajo
        Dim i, j As Integer
        i = pos \ 10 + 2
        j = pos Mod 10 + 1
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function

    Public Shared Function operador7(ByVal pos As Integer) As Integer 'uno izquierda dos abajo
        Dim i, j As Integer
        i = pos \ 10 + 2
        j = pos Mod 10 - 1
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function
    Public Shared Function operador8(ByVal pos As Integer) As Integer 'dos izquierda uno abajo
        Dim i, j As Integer
        i = pos \ 10 + 1
        j = pos Mod 10 - 2
        If (i <= 8 And i >= 1) And (j <= 8 And j >= 1) Then
            Return CStr(i) + CStr(j)
        Else
            Return pos
        End If
    End Function
    
    
   

End Class
